﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MForm;
using BLL;

namespace AppManage
{
    public partial class LoginForm : MasterForm
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.No;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            UserBLL ub = new UserBLL();
            if (!ub.Login(txtLoginName.Text,txtPasswd.Text))
            {
                MessageBox.Show("登录失败,请检查用户名和密码是否正确");
                DialogResult = DialogResult.None;
                txtLoginName.Focus();
                return;
            }            
            DialogResult = DialogResult.OK;
        }
    }
}